<?php
/**
* 名称：招聘模块控制器。
* 描述：招聘模块相关的控制响应程式。
*/
final class Controller_Job extends Controller{
    /**
    * 描述：列表视图程式。
    * @access protected
    * @return void
    */
    protected function Listview(){
        $deparment=Route::GetArguments('department');
        //~
        $this->Data['meta']=array(
            'title'=>self::$Database->GetOne(
                'SELECT name FROM '.self::$Database->Table('job_department').' WHERE id=? ORDER BY id DESC',
                array($deparment)
            ),
            'title_link'=>route::MakeHyperlink(':job::listview',array('department'=>$deparment))
        );
        //~
        $this->Data['job']=self::$Database->GetAll(
            'SELECT * FROM '.self::$Database->Table('job').' WHERE department=? ORDER BY id DESC',
            array($deparment)
        );
        //~
        $this->Data['contact']=self::$Database->GetRow(
            'SELECT value_1 as linkman,value_2 as phone,value_3 as email FROM '.self::$Database->Table('job_setting').' WHERE id=1'
        );
        //~
        self::$Template->Assign('data',$this->Data);
        self::$Template->Display('job/list.html');
    }
}